package jvm.oom;

import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import java.util.concurrent.TimeUnit;

public class Test1 {


    public static void main(String[] args) throws InterruptedException {
         List<byte[]> vector =new ArrayList<>();
        for (int i = 0;i<500;i++){
            byte[] b = new byte[1024*1024];
            vector.add(b);
        }
        System.gc();
        TimeUnit.SECONDS.sleep(4);
        for (int i = 0;i<500;i++){
            byte[] b = new byte[1024*1024];
            vector.add(b);
        }
    }
}
